package mythesis.gui.main.components;
import mythesis.gui.main.components.api.MenuButton;
import javafx.scene.*;
import javafx.scene.shape.*;
import javafx.scene.paint.*;
import javafx.scene.text.*;
import javafx.scene.input.*;
import javafx.ext.swing.*;

public class EventBar extends CustomNode
{
    public var event = 0;
    public var toInputLine = 0;
    public var isDragging = false;
    var text = "When the game starts...";
    
    public var eventDescription:String[] = 
    [ 
    	"State and sets notes accessible from any event.",
    	"Think about which room you want to approach.  Where should I go?",
    	"Suggest the killer, the weapon used and the place of the crime.  Maybe even make an accusation?",
    	"Listen to what other players are suggesting.  Did someone disprove the suggestion?",
    	"When I have to disprove the suggestion of another player, which card should I use?"
    ];
    
    public var group = Group
    {
        
       	content:
       	[
       		Rectangle
       		{
       		    width     : 660
       		    height    : 35
       		    arcHeight : 5
       		    arcWidth  : 5
       		    fill      : Color.web("#004A6F")
       		    
       		}
       		Text
       		{
       		    x         : 25
       		    y         : 25
       		    content   : bind text
       		    font      : Font.font("Courier New", FontWeight.BOLD, 16)
       		    fill      : Color.WHITE
       		}
			MenuButton // When the game starts...
			{
			    translateX: 510
			    translateY: 5
			    onMousePressed: function(e:MouseEvent):Void
			    {
			        if (toInputLine == -1 and isDragging == false)
			        {
			    		event = 0;
			    		text  = "When the game starts...";
			    		
			    	}
			    }
			}
			MenuButton // Deciding on movement...
			{
			    translateX: 540
			    translateY: 5
			    onMousePressed: function(e:MouseEvent):Void
			    {
			        if (toInputLine == -1 and isDragging == false)
			        {
			    		event = 1;
			    		text  = "Deciding on movement...";
			    	}
			    }
			}
			MenuButton // Deciding on suggestion and accusation...
			{
			    translateX: 570
			    translateY: 5
			    onMousePressed: function(e:MouseEvent):Void
			    {
			        if (toInputLine == -1 and isDragging == false)
			        {
			    		event = 2;
			    		text  = "Deciding on suggestion and accusation...";
			    	}
			    }
			}
			MenuButton // Listening to suggestions
			{
			    translateX: 600
			    translateY: 5
			    onMousePressed: function(e:MouseEvent):Void
			    {
			        if (toInputLine == -1 and isDragging == false)
			        {
			    		event = 3;
			    		text  = "Listening to suggestions...";
			    	}
			    }
			}
			MenuButton // Disproving suggestions
			{
			    translateX: 630
			    translateY: 5
			    onMousePressed: function(e:MouseEvent):Void
			    {
			        if (toInputLine == -1 and isDragging == false)
			        {
			    		event = 4;
			    		text  = "Disproving the suggestion yourself...";
			    	}
			    }
			}
       	] 
    }
    override public function create() : Node
    {
        return group;
    }
}